<%@ page import="java.util.*" %>
<%@ page import="util.*" %>

<html>
  <head>
    <title>Sistema CDs</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <h1>Sistema CDs</h1>
  <h2>Listado de CDs</h2>
  <% List CDs = (List)request.getAttribute("CDs"); %>
  
  <a href='/listaBandas'>Bandas</a>/<a href='/listaTracks'>Tracks</a>/<a href='/listaClientes'>Clientes</a>/<a href='/listaCDs'>Cds</a>/<a href='/listaDependientes'>Dependientes</a>/<a href='/listaVentas'>Ventas</a>
  <table>
    <thead>
      <tr>
        <th>Nombre</th><th>A&ntilde;o publicaci&oacute;n</th><th>Precio</th><th>Acciones</th>
      </tr>
    </thead>
    <tbody>
      <% for(int i = 0, n = CDs.size(); i < n; i++) {
        CDDTO CD= (CDDTO) CDs.get(i); %>
        <tr>
          <td><%= CD.getNombre() %></td>
          <td><%= CD.getAnoPublicacion() %></td>
          <td><%= CD.getPrecio() %></td>
          <td>
            <a href='/detalleCD?pk_CD=<%= CD.getPk_CD() %>'>
                <input type="submit" value="Detalle"/>
            </a>
            <a href='/eliminarCD?pk_CD=<%= CD.getPk_CD() %>'>
              <input type="submit" value="Eliminar"/>
            </a>
          </td>
        </tr>
      <% } %>
    </tbody>
    <tfoot>
      <tr>
        <td>
          <a href='/agregarCD.jsp'>
            <input type="submit" name="action" value="Agregar"/>
          </a>
        </td>
        <td></td><td></td><td></td>
      </tr>
    </tfoot>
  </table>
</html>